package org.example.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.example.domain.po.ErpDepotHead;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.example.domain.po.Purchase;
import org.example.domain.po.Retail;
import org.example.domain.vo.ErpDepotHeadPurchaseVo;
import org.example.domain.vo.ErpDepotHeadRetailVo;

import java.util.List;

/**
* @author 24059
* @description 针对表【erp_depot_head(单据主表)】的数据库操作Mapper
* @createDate 2024-10-17 11:02:58
* @Entity org.example.domain.po.ErpDepotHead
*/
public interface ErpDepotHeadMapper extends BaseMapper<ErpDepotHead> {
    Page<ErpDepotHead> selectByExample(Page<ErpDepotHead> page, @Param("number")String number, @Param("color")String color,
                                       @Param("createTime")String createTime, @Param("operTime")String operTime,
                                       @Param("username")String username, @Param("name")String name, @Param("status")String status,
                                       @Param("remark")String remark, @Param("standard")String standard,@Param("supName") String supName,@Param("tenantId") Long tenantI);
    int updateOrderStatus(@Param("ids") List<Integer> ids, @Param("status") String status);
    int insertdd(ErpDepotHead erpDepotHead);

    Page<ErpDepotHead> findPage(Page<ErpDepotHead> erpDepotHead,
                                @Param("number") String number,
                                @Param("status") String status,
                                @Param("type") String type,
                                @Param("subType") String subType,
                                @Param("depId")Long depId,
                                @Param("organId")Long organId,
                                @Param("userId")Long userId,
                                @Param("createTime")String createTime,
                                @Param("endTime")String endTime,
                                @Param("model")String model
    );
    Page<ErpDepotHead> selectOderck(Page<ErpDepotHead> page, @Param("number")String number,
                     @Param("accountname")String accountname,
                     @Param("color")String color, @Param("createTime")String createTime,
                     @Param("operTime")String operTime, @Param("username")String username,
                     @Param("supName")String supName, @Param("status")String status,
                     @Param("remark")String remark,
                     @Param("standard")String standard,
                                    @Param("supplier") String supplier,
                                    @Param("changeAmount")String changeAmount,
                                    @Param("dname")String dname,@Param("debt")String debt,@Param("tenantId") Long tenantId);
    Page<ErpDepotHead> selectOderth(Page<ErpDepotHead> page, @Param("number")String number,@Param("discountLastMoney") String discountLastMoney,
                                    @Param("accountname")String accountname,
                                    @Param("color")String color, @Param("createTime")String createTime,
                                    @Param("operTime")String operTime, @Param("username")String username,
                                    @Param("supName")String supName, @Param("status")String status,
                                    @Param("remark")String remark,
                                    @Param("standard")String standard,@Param("supplier") String supplier,@Param("changeAmount")String changeAmount,@Param("dname")String dname,@Param("debt")String debt,@Param("tenantId") Long tenantId);
    Long finbyid(@Param("number")String number);
    int updateOrder(ErpDepotHead erpDepotHead,@Param("id")Long id);
    Page<ErpDepotHead>selectOut(Page<ErpDepotHead> page, @Param("number")String number,
                                @Param("createTime")String createTime, @Param("operTime")String operTime,@Param("standard")String standard,@Param("id") Long id,@Param("subType") String subType,@Param("tenantId") Long tenantId);
    Page<ErpDepotHead>selectOut2(Page<ErpDepotHead> page, @Param("number")String number,
                                @Param("createTime")String createTime, @Param("operTime")String operTime,@Param("standard")String standard,@Param("organId") Long organId);

    Page<ErpDepotHead>RetailOut(Page<ErpDepotHead> page, @Param("number")String number,
                                @Param("createTime")String createTime, @Param("operTime")String operTime,@Param("standard")String standard,@Param("id") Long id,@Param("subType") String subType);
    Page<ErpDepotHead>selectOutth(Page<ErpDepotHead> page, @Param("number")String number,
                                @Param("createTime")String createTime, @Param("operTime")String operTime,@Param("standard")String standard,@Param("id") Long id);
    int insertck(ErpDepotHead erpDepotHead);
    int updateOrderStatus2(@Param("linkNumber") String linkNumber);

    Long lookByHeaderId(@Param("number") String number);

    int updateOrderStatus3(@Param("linkNumber") String linkNumber);


    Page<ErpDepotHeadPurchaseVo> PurchaseFindByPage(Page<ErpDepotHeadPurchaseVo> page,@Param("purchase") Purchase purchase,@Param("tenantId") Long tenantId);

    int deprotinsert(ErpDepotHead erpDepotHead);
    int depotinserttwo(ErpDepotHead erpDepotHead);
    int updateDepotHead(@Param("depotHead")ErpDepotHead erpDepotHead, @Param("number")String number);
    List<ErpDepotHead>findherfid(@Param("headerId")Long headerId);

    int insertPurchase(ErpDepotHead erpDepotHead);

    //    零售出库
    Page<ErpDepotHeadRetailVo> select1(Page<ErpDepotHeadRetailVo> page, @Param("retail") Retail retail, @Param("tenantId") Long tenantId);
    //    零售退货
    Page<ErpDepotHeadRetailVo> select2(Page<ErpDepotHeadRetailVo> page, @Param("retail") Retail retail, @Param("tenantId") Long tenantId);
    //零售删除
    int deleteRetail(@Param("id") Long id );
    int depotinsertdb(ErpDepotHead erpDepotHead);
    List<ErpDepotHeadRetailVo>selectLm();


    Page<ErpDepotHead> selectByqtrk(Page<ErpDepotHead> page);
    Page<ErpDepotHead> select3(Page<ErpDepotHead> page);
    Long RetailInDetail(@Param("linkId") Long linkId);
    Long RetailInDetailty(@Param("id") Long id);

    Long RetailIn(@Param("id") Long id);
    int updateRetail(@Param("id") Long id);
    int updateRetail3(@Param("id") Long id);
    int updateRetail4(@Param("id") Long id,@Param("status") String status);
    String select4(@Param("id") Long id);
    Long  select5(@Param("number") String number);
    Long  select6(@Param("linkNumber") String linkNumber);
    Long  select7(@Param("id") Long id);
    List<Long>  select8(@Param("headerId") Long headerId);
    String  select10(@Param("headerId") Long headerId);

    Long  select9( @Param("linkIds") List<Long> linkId);
}




